package com.yycx.module.bus.provider.handler.haiying.order.waybill;

import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.base.utils.FlymeUtils;
import com.yycx.common.mybatis.interceptor.PageInterceptor;
import com.yycx.common.mybatis.query.CriteriaQuery;
import com.yycx.module.bus.client.entity.hy.HyOrderDetail;
import com.yycx.module.bus.client.enums.HySaleTypeEnum;
import com.yycx.module.bus.provider.service.BusOrderService;
import com.yycx.module.bus.provider.service.hy.HyOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

/**
 * 商品打印明细处理器
 *
 * @author zyf
 */
@Component
public class HyPrintOrderDetailsHandler implements PageInterceptor<HyOrderDetail> {



    @Override
    public List<EntityMap> complete(CriteriaQuery<HyOrderDetail> cq, List<EntityMap> result, EntityMap extra) {
        for (EntityMap map : result) {
            BigDecimal drugJs = map.getBigDecimal("printDrugJs");
            map.put("drugJsCount", drugJs.setScale(0, BigDecimal.ROUND_UP));
        }
        return result;
    }
}
